---
id: 64dc92a9718fb53ca3d1bad7
title: Step 9
challengeType: 20
dashedName: step-9
---

# --description--

The Tower of Hanoi puzzle can be solved in 2<sup>n</sup> - 1 moves, where n is the number of disks. Declare a variable named `number_of_moves` and assign the total number of moves to this variable.

The power operator in Python is `**`.

# --hints--

You should declare a variable named `number_of_moves`.

```js
({ test: () => assert(__userGlobals.has('number_of_moves')) })
```

The value of `number_of_moves` should be the expression to calculate the number of moves.

```js
({ test: () => {
    assert(__pyodide.runPython(`        
        a = __locals.get('NUMBER_OF_DISKS')
        __locals.get('number_of_moves') == 2**a -1        
    `))
} })
```

# --seed--

## --seed-contents--

```py
--fcc-editable-region--
NUMBER_OF_DISKS = 3

--fcc-editable-region--
rods = {
    'A': list(range(NUMBER_OF_DISKS, 0, -1)),
    'B': [],
    'C': []
}
def move():
    pass
```
